package com.itlong.cloud.commons.resource;

import com.itlong.cloud.commons.service.ITimeTaskOfOperationLogService;
import com.itlong.cloud.noncore.commons.ITimeTaskOfOperationLogServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      系统操作日志转移冷表数据
 * </desc>
 *
 * @createDate 2018/1/18
 */
@RestController
public class TimeTaskOfOperationLogServiceResource implements ITimeTaskOfOperationLogServiceClient {
    @Autowired
    ITimeTaskOfOperationLogService iTimeTaskOfOperationLogService;

    /**
     * <desc>
     *     系统操作日志定时转移至冷表数据
     * </desc>
     * @return
     * @author cuiduanwu
     * @createDate 2018/1/18
     */
    @RequestMapping(path = "/timeTask/operationLogProcess",method = RequestMethod.POST)
    public boolean timTaskOfOperationLogProcess() throws Exception{
        return iTimeTaskOfOperationLogService.timTaskOfOperationLogProcess();
    }

    /**
     * <desc>
     *      定时任务定期清理数据
     * </desc>
     *
     * @author wangzhi
     * @createDate 2019/09/04
     */
    @Override
    @RequestMapping(path = "/timeTask/regularCleanData",method = RequestMethod.POST)
    public void regularCleanData() throws Exception {
        iTimeTaskOfOperationLogService.regularCleanData();
    }
}
